<%@ page import="t_4s.Admin" %>
<%@ page import="t_4s.AdminDaolmpl" %><%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2021/9/9
  Time: 16:56
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%
    request.setCharacterEncoding("UTF-8");
    int id= Integer.parseInt(request.getParameter("id"));
    String name=request.getParameter("name");
    String btn=request.getParameter("btn");
    AdminDaolmpl adminDaolmpl=new AdminDaolmpl();
    if (btn.equals("删除")){
        int count=adminDaolmpl.delete(id);
        if (count>0){
            out.println("删除成功！");
        }else {
            out.println("删除失败！");
        }
    }else if (btn.equals("修改")){
        Admin admin=new Admin(name,id);
        int count=adminDaolmpl.upduser(admin);
        if (count>0){
            out.println("修改成功");
        }else {
            out.println("修改失败");
        }
    }
%>
</body>
</html>
